const a =  {
    name: 'add',
    label: '新增',
    ui: {
      props: { type: 'primary', preIcon: 'bi:plus-lg' },
      events: {
        onClick: `return function ({ $grid }, _, { button }, { dc: { open } }) {
          const transfer = { eFormZwxmPlan: {}, eFormZwxmBase: {}, eGridZwxmIncome: [{}], eGridZwxmPlan: [{}] };
          const layout = { id: 'pZwxmM' };
          const modal = {
            title: '新增项目',
            width: '75vw',
            height: document.body.clientHeight * 0.7,
            minHeight: document.body.clientHeight * 0.7,
            defaultFullscreen: false,
            open: true,
            showOkBtn: true,
            showCancelBtn: true,
          };
          const inner = {
            onOk: async function (_, { origin }, { xe: { get, isEmpty, omit, set }, dc: { close, http } }) {
              const item = get(origin, 'eFormZwxmBase', {});
              const { GUID } = await http.form({ url: '/zw/czItem/getGuid', data: {} });
              set(item, 'GUID', GUID);
              Object.assign(item, get(origin, 'eFormZwxmPlan', {}));
              const subList = [];
              const subs = { eGridZwxmPlan: 1, eGridZwxmIncome: 2 };
              for (const key of Object.keys(subs)) {
                for (const it of get(origin, key, [])) {
                  const val = omit(it, ['id']);
                  if (isEmpty(val)) continue;
                  val.CTYPE = subs[key];
                  val.ITEMGUID = item.GUID;
                  val.GUID = (await http.get({ url: '/zw/czItem/getSubGuid'})).GUID;
                  val.state = 'added';
                  subList.push(val);
                }
              };
              const fileList = [];
              const list = get(origin, 'eGridZwxmFile', []);
              for (const it of list) {
                const val = omit(it, ['id']);
                if (isEmpty(val)) continue;
                val.ITEMGUID = item.GUID;
                val.GUID = (await http.get({ url: '/zw/czItem/getSubGuid'})).GUID;
                val.state = 'added';
                fileList.push(val);
              }
              await http.post({
                url: '/zw/czItem/saveItem',
                data: { item, option: 'added', subList },
              });
              close(origin);
            },
          };
          console.log('inner click: ', $grid, button, { inner, layout, modal, transfer });
          open({ inner, layout, modal, transfer });
        };`,
      },
    },
  }